<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Insert title here</title>
        <script type="text/javascript">
        	function mouseover(){
				alert("on mouser over");				
			}
			function mouseclick(){
				var cc =confirm("on mouser click");				
				if(!cc){
					return false;
				}
			}
			function dosquare(){
				var num=document.getElementById("num2").value;
				document.getElementById("val2").value=num*num;			
			}
			function processform(targetform){
				var succ=true;
				var numval=targetform.num2.value;
				alert(typeof(numval));
				if(numval==''){
					alert("num is null");
					succ=false;
				}else{
					if(typeof(targetform.val2.value)!="number"){
						alert("val is not a number");
						succ=false;
					}
				}
				return succ;
			}
			function loaddate(){
				var dated=new Date();
				document.forms[0].date2.value=dated.getFullYear()+"/"+(dated.getMonth()+1)+"/"+dated.getDate();
			}
        </script>
    </head>
    <body onload="loaddate();" onunload="alert('goodbye');">
        <a href="http://www.baidu.com" onmouseover="mouseover();">onMouseOver</a>
        <br>
		<a href="http://www.baidu.com" onclick="return mouseclick();">onClick</a>
        <br>
		<form action="http://www.baidu.com" onsubmit="return processform(this)">
			number<input type="text" id="num2" name="num2" onchange="dosquare();"/>:<input type="text" id="val2" name="val2"/>
			<br>date<input type="text" name="date2" id="date2"  onfocus="this.value='';" onblur="alert('this is date');"/>
			<select name="sel" onchange="this.form.sel2.value=this.value;">
			<option value="1">one</option>	
			<option value="2">two</option>	
			<option value="3">three</option>	
			</select>
			<input type="text" name="sel2" id="sel2"/>
			<input type="submit"/>
		</form>
    </body>
</html>
